#include <bits/stdc++.h>
using namespace std;

int main(){
	long long time;
	scanf("%lld",&time);
	
	int hour,min,second;
	time /=1000;
	time %=(24*60*60);
	
	hour=time/(60*60);
	min=time/60-hour*60;
	second=time-(hour*60+min)*60;
	
	printf("%02d:%02d:%02d",hour,min,second);
	return 0;
}
